<template>
  <div class="container-hoslist">
    <ul class="hos-list">
      <li class="list-item"
          v-for="(item, index) in hos_list"
          :key="index"
          @tap="to_detail(item)">
        <div class="left">
          <!-- 头像 -->
          <div class="hos-logo">
            <img :src="img_url+item.logo"
                 v-if="img_url&&item.logo"
                 alt
                 class="img" />
            <div class="logo-icon"
                 v-if="item.exam_info_label==1||item.examStatus==1">
              245项严选
            </div>
          </div>
        </div>
        <!-- 医院信息 -->
        <div class="info">
          <div class="hos-name">
            <div class="hos-msg">{{item.name}}</div>
            <!-- 分数 -->
            <div class="grade"
                 v-if="item.exam_info_label==1||item.examStatus==1">
              <img :src="base_url+'/mp_3.2.0/245%E4%B8%A5%E9%80%89/%E8%AF%84%E5%88%86/iOS/%E5%BD%A2%E7%8A%B6%202%403x.png'"
                   v-if="base_url"
                   alt=""
                   class="grade-icon">
              <div class="grade-num">{{item.exam_info_score||item.examScore}}分</div>
            </div>
            <!-- 右上角等级 -->
            <div class="leval"
                 v-if="item.tag">
              <div class="msg">{{item.tag}}</div>
            </div>

          </div>
          <div class="address">
            <div class="icon">
              <img :src="base_url+'/mp_2.4/search/dingwei.png'"
                   v-if="base_url"
                   alt
                   class="img" />
            </div>
            <div class="msg">{{item.address}}</div>
          </div>
          <!-- 90天不满意退款 -->
          <div class="tip_box">
            <div class="tip"
                 v-if="item.label">{{item.label}}</div>
            <div class="tip"
                 v-if="item.gold_status ==1||item.goldStatus ==1">全金币抵扣</div>
          </div>

          <!-- 医生数 项目数 -->
          <div class="tags clearfix">
            <div class="tag-item doctor">预约:{{item.reservationNumber}}</div>
            <div class="tag-item project">案例:{{item.caseNumber}}</div>
          </div>
          <!-- 广告标签 -->
        </div>
        <div class="ad-tag"
             v-if="item.top==1">广告</div>
      </li>
    </ul>
  </div>
</template>

<script>
import common from "@/assets/js/mmk_common.js";
import imageurl from "@/assets/js/image.js";
export default {
  data () {
    return {
      base_url: common.image_resource,
      img_url: common.image_response,
      score: 4
    };
  },
  methods: {
    to_detail (item) {
      wx.navigateTo({
        url: "/pages/package_projects/hospital_detail/main?hos_id=" + item.id
      });
    }
  },
  components: {},
  props: ["hos_list"],
  created () { }
};
</script>

<style lang="less" scoped>
.container-hoslist {
  .tip_box {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .hos-list {
    padding: 0 10px;
    .list-item {
      display: flex;
      padding: 12px 10px;
      background-color: #fff;
      box-shadow: 0px 2px 6px 0px rgba(240, 240, 240, 1);
      border-radius: 5px;
      margin-bottom: 10px;
      position: relative;
      .left {
        width: 50px;
        height: 50px;
        position: relative;
        .hos-logo {
          width: 100%;
          height: 100%;
          border-radius: 50%;
          background-color: #ccc;
          .img {
            width: 100%;
            height: 100%;
            display: block;
          }
          .logo-icon {
            width: 50px;
            height: 17px;
            background: linear-gradient(
              226deg,
              rgba(254, 120, 161, 1) 0%,
              rgba(254, 123, 136, 1) 100%
            );
            border-radius: 0px 10px 0px 8px;
            font-size: 9px;
            font-family: "PingFangSC-Regular", "PingFang SC";
            font-weight: 400;
            color: rgba(255, 255, 255, 1);
            line-height: 17px;
            text-align: center;
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translate(-50%, 50%);
          }
        }

        .tip {
          width: 11px;
          height: 11px;
          position: absolute;
          bottom: 1px;
          right: 3px;
          .img {
            width: 100%;
          }
        }
      }
      .info {
        flex: 1;
        padding-left: 10px;
        .hos-name {
          display: flex;
          .hos-msg {
            font-size: 14px;
            font-family: "PingFangSC-Regular";
            font-weight: 400;
            color: rgba(51, 51, 51, 1);
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 1;
            -webkit-box-orient: vertical;
            vertical-align: middle;
          }
          .grade {
            margin-left: 20px;
            vertical-align: middle;
            margin-top: 1px;
            .grade-icon {
              width: 9px;
              height: 11px;
              display: inline-block;
              vertical-align: middle;
              margin-right: 2px;
            }
            .grade-num {
              font-size: 9px;
              font-family: "PingFangSC-Regular", "PingFang SC";
              font-weight: 400;
              color: rgba(255, 132, 48, 1);
              line-height: 13px;
              display: inline-block;
              vertical-align: middle;
            }
          }

          .leval {
            margin-left: 29px;
            margin-top: 1px;
            vertical-align: middle;
            .msg {
              padding-left: 12px;
              padding-right: 6px;
              height: 15px;
              line-height: 15px;
              background: rgba(255, 152, 108, 1);
              box-shadow: 0px 1px 1px 0px rgba(255, 91, 118, 0.42);
              border-radius: 7px;
              font-size: 10px;
              font-family: "PingFangSC-Medium";
              font-weight: 500;
              color: rgba(255, 255, 255, 1);
              position: relative;
              &::before {
                content: "";
                width: 18px;
                height: 18px;
                line-height: 18px;
                text-align: center;
                border-radius: 50%;
                display: block;
                background-image: url("https://h5.ameimeika.com/mp_images/mp_2.4/search/vvvvv@2x.png");
                background-repeat: no-repeat;
                background-size: cover;
                box-shadow: 0px 1px 2px 0px rgba(255, 98, 117, 0.61);
                position: absolute;
                left: 0;
                top: 50%;
                transform: translate(-50%, -50%);
                font-size: 12px;
                font-weight: 500;
                color: rgba(255, 255, 255, 1);
              }
            }
          }
        }
        .address {
          margin-top: 5px;
          display: flex;
          .icon {
            width: 12px;
            padding-top: 4px;
            .img {
              width: 11px;
              height: 12px;
              display: block;
            }
          }
          .msg {
            flex: 1;
            font-size: 12px;
            font-family: "PingFangSC-Regular";
            font-weight: 400;
            color: rgba(102, 102, 102, 1);
            line-height: 17px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
          }
        }
        .tip {
          padding: 0 6px;
          height: 16px;
          background: rgba(255, 211, 156, 1);
          box-shadow: 0px 1px 1px 0px rgba(255, 91, 118, 0.42);
          border-radius: 11px;
          font-size: 10px;
          font-family: "PingFangSC-Medium", "PingFang SC";
          font-weight: 500;
          color: rgba(255, 255, 255, 1);
          line-height: 16px;
          text-align: center;
          margin-top: 10px;
          margin-right: 8px;
        }
        .tags {
          margin-top: 10px;
          .tag-item {
            width: auto;
            height: 20px;
            // border-radius: 10px;
            font-size: 12px;
            font-family: "PingFangSC-Regular";
            font-weight: 400;
            color: #999;
            line-height: 20px;
            text-align: center;
            float: left;
            margin-right: 10px;
          }
          .project {
            padding-left: 10px;
          }
          .doctor {
            position: relative;
            padding-right: 10px;
            &.doctor::after {
              position: absolute;
              content: "";
              width: 3px;
              height: 10px;
              background: linear-gradient(
                180deg,
                rgba(238, 238, 238, 0) 0%,
                rgba(228, 228, 228, 1) 46%,
                rgba(216, 216, 216, 0) 100%
              );
              border-radius: 2px;
              top: 30%;
              right: -10%;
            }
            // background: rgba(255, 133, 154, 1);
          }
        }
      }
      .ad-tag {
        width: 26px;
        height: 11px;
        font-size: 8px;
        font-family: PingFangSC-Medium, PingFang SC;
        font-weight: 500;
        color: rgba(255, 255, 255, 1);
        line-height: 11px;
        position: absolute;
        right: 10px;
        bottom: 10px;
        background: rgba(51, 51, 51, 0.4);
        border-radius: 2px;
        text-align: center;
        line-height: 11px;
      }
    }
  }
}
.img-yx {
  position: absolute;
  width: 50px;
  height: 16px;
  top: 50px;
}
.score {
  position: absolute;
  top: 13px;
  right: 94px;
  img {
    width: 9px;
    height: 11px;
    vertical-align: middle;
  }
  span {
    font-size: 10px;
    color: rgba(255, 132, 48, 1);
    margin-left: 2px;
  }
}
</style>
 


